//package modified_snake_game;

import javax.swing.JFrame;

@SuppressWarnings("serial")
public class Snake extends JFrame {

    public Snake(boolean custom, Settings settings) 
    {
    	int width = 320;
    	int height = 340;
    	int speed = 50;
    	int bgcolor = 0;
    	int difficulty = 1;
    	
    	if(custom == true)
    	{
	    	width = settings.getWidth() ;
	    	height = settings.getHeight();
	    	speed =  settings.getSpeed();
	    	bgcolor =  settings.getBackground();	// can we set difficulties?
	    	difficulty = settings.getDifficulty();
    	}
    	
    	if(difficulty == 1)
    	{
    		add(new Board(width, height, speed, bgcolor));
    	}
    	else if(difficulty == 2)
    	{
    		add(new Board2(width, height, speed, bgcolor));
    	}
    	else if(difficulty == 3)
    	{
    		add(new Board3(width, height, speed, bgcolor));
    	}
    	
    	setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
        setSize(width, height);
        setLocationRelativeTo(null);
        setTitle("Snake");

        setResizable(false);
        setVisible(true);
    }

}
